<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Log</title>
<#assign contextPath = request.contextPath/>
<script language="javascript" src="${contextPath}/log/js/jquery-1.4.2.min.js"></script>
<!-- improt Jquery UI -->
<script language="javascript" src="${contextPath}/log/js/jquery-ui-1.8.1.custom.min.js"></script>
<link type="text/css" rel="stylesheet" media="screen" href="${contextPath}/log/css/jquery-ui-1.8.1.custom.css">
<!-- import Jquery DynaTree-->
<script language="javascript" src="${contextPath}/log/js/jquery.dynatree.js"></script>
<script language="javascript" src="${contextPath}/log/js/jquery.dataTables.min.js"></script>
<script language="javascript" src="${contextPath}/log/js/jquery.dataTables.plugin.js"></script>
<!--public js--> 
<link type="text/css" rel="stylesheet" media="screen" href="${contextPath}/log/css/skin/ui.dynatree.css">
<link type="text/css" rel="stylesheet" media="screen" href="${contextPath}/log/css/dataTable.css">

<style type="text/css">
html{}
body{margin:0px;background:#D6D3CE;}
body,div,input,select,td,th{font-size:12px;font-weight:bold;font-family:Helvetica,sans-serif,Arial;}
button {font-size:12px;font-weight:bold;font-family:Helvetica,sans-serif,Arial;}
.display{border-top:1px solid #DDD;overflow-y:auto;overflow-x:hidden;}
.nav{clear:both;background:url("../images/nav.gif");height:60px;border-bottom:1px solid #424142;padding:0px 0px 0px 5px;}
.nav li{float:left;width:50px;height:45px;padding:10px 0px 0px 8px;background:url("../images/line.gif") right 5px no-repeat}
.nav li A{float:left;width:40px;height:35px;padding:5px 0px 0px 0px;text-align:center;}
.nav li A img{vertical-align:middle;border:0px solid #FFF;}
.nav li A:hover{background:url("../images/ahover.gif") 0px 3px no-repeat;}
.navi{overflow:auto;height:550px;width:100%;margin:0px;background:#D6D3CE;}
	.tabs-bottom { position: relative; } 
	.tabs-bottom .ui-tabs-panel {height:488px;overflow:auto;background-color:#fff;border:4px;border-style:inset; padding:0px;}
	#content_tabs { margin-top: 0px;}
	#content_tabs ul li{height: 25px;}
	#content_tabs a{height: 20px;}
	#content_tabs li .ui-icon-close { float: left; margin: 0.4em 0.2em 0 0; cursor: pointer; }
	#content_tabs .ui-tabs-panel{padding: 0px; overflow:hidden;}
	#navibar {height:538px; overflow:hidden;}
	#content_tabs .navi{height:530px; overflow:hidden;}
	.hidden_input{display:none;}
	
	div.ui-dynatree-container
{
	font-family: tahoma, arial, helvetica;
	font-size: 10pt; /* font size should not be too big */
	white-space: nowrap; 
	padding: 3px;
	
	background-color: #D6D3CE; 
	border: 1px dotted gray;
}

table.display tr.even.row_hover td {
	background: #F7F7F7;
}

table.display tr.even.row_selected td {
	background: #3366CC;
	color:#FFF;
}

table.display tr.odd.row_hover td {
	background: #F7F7F7;
}

table.display tr.odd.row_selected td {
	background: #3366CC;
	color:#FFF;
}
</style>

<script>
function showModelessDialogEx(url, argv, maxWidth, maxHeight) {
	argv = argv || window;

	var ie = !-[ 1, ];
	if (ie) {
		var sFeatures = "dialogHeight:" + maxHeight + "px;dialogWidth:"
				+ maxWidth + "px;scroll:1;status:0;";
		window.showModelessDialog(url, argv, sFeatures);
	} else {
		window.open(url, "", "modal=yes,width=" + maxWidth + ",height="
				+ maxHeight + ",resizable=no,scrollbars=yes");
	}

}

  	$(document).ready(function(){
  	  var logTable;
  	  $('input[name="logView"]').live('click',function(){
  	   var logId = $(this).attr('id');
  	   var data = fnGetData(logId,logTable);
  	   var key = data[3]+"."+data[4];
  	   showModelessDialogEx("${contextPath}/redamLog/log-loadValue.action?logId="+data[0]+"&bizType="+ data[3] +"&bizOperation="+data[4]+"&recordValue=" +data[10],window,"500px","300px");
  	});
  	
  	function showValue(bizValues){
  	    var div = document.createElement("div");
        var textarea = document.createElement("textarea");
        $(textarea).text(bizValues[0].beforeValue+bizValues[0].afterValue);
        $(textarea).attr('style','overflow-x:scroll,overflow-y:scroll');
        $(textarea).width(600);
        $(textarea).height(500);
        $(div).append(textarea);
        $(div).dialog({ height: 550,width:610,title:"ValueChagnge",resizable:false });
  	}
  	  
  	  $("#deskTree").dynatree({
  	  
  	     onClick: function(dtnode){
  	        var url = "${contextPath}/redamLog/log-loadData.action?bizOperation="+dtnode.data.bizOperation+"&bizType="+dtnode.data.bizType;
            logTable.fnReloadAjax(url,function(){});
  	     },
  	     
  	     onLazyRead: function(dtnode){
				  dtnode.appendAjax({  
					     url: "${contextPath}/redamLog/log-loadNode.action", 
						 dataType: "json", 
					     data: "key="+dtnode.data.key
				});
		  },// onLazyRead
		  
  	  });
  	  
  	  
     //返回管理界面
    $('a[name="return"]').click(function(){
      history.go(-1);
    });
    
    logTable= $('#logTable').dataTable({
		"aoColumns": [ 
			/* keyId*/  { "bVisible": false},
			/* bizDate*/  {"sClass":"red"},
			/* result */  {"sClass":"cc"},
			/* operation*/ null,
			/* bizType*/  null,
			/* exception*/  {"bVisible": false},
			/* system*/  null,
			/* operator*/   null,
			/* serverIp*/  null,
			/* clientIp*/   null,
			/* recordValue */ { "bVisible": false},
			/* valueChange*/    {"fnRender": function ( oObj ) {return "<input type=button id="+oObj.aData[0]+" name=logView value=查看 />"}}
		],
		"bAutoWidth": false,			//自适应浏览器宽度
	  });
    

     
  	});
	
</script>

</head>

<body>
<ul class="nav">
   <li><a name="return"><img src="${contextPath}/images/static/logout.png" border="0" title="Logout"/></a></li>
</ul>
<table width="100%" border="0">
<tr>
	<td width="250px" valign="top">
		<div class="navi" id="navibar">
		 <div id="deskTree" class="navi">
						<ul style="display:none">
						   <#list bizOperations as bizOperation>						      
							  <li data="bizOperation:'${bizOperation}',bizType:'',key:'${bizOperation}',isFolder:true,isLazy:true,"><@lps.i18n key=bizOperation path="log"/></li>
						   </#list>
						</ul>
			</div>
	  </div>
	</td>
	<td valign="top">
		<div id="content_tabs"><div class="navi">
<FIELDSET>
<LEGEND>Log</LEGEND>
<div onselectstart="return false" >
<table width="100%" border="0" cellpadding="5" id="logTable" cellspacing="0" class="display">
	<thead>
	  <tr height="0px">
	    <th name="keyId">Id</th>
		<th name="bizDate">Date</th>
		<th name="result">Result</th>
		<th name="operation">Operation</th>
		<th name="bizType">BizType</th>
		<th name="exception">Exception</th>
		<th name="system">System</th>
		<th name="operator">Operator</th>
		<th name="serverIp">ServerIp</th>
		<th name="clientIp">ClientIp</th>
		<th name="recordValue">recordValue</th>
		<th name="valueChange">值改变</th>
	  </tr>
	</thead>
	<tbody>
	</tbody>
</table>
</div>
</FIELDSET>
		</div></div>
	</td>
</tr>
</table>


</body>
</html>